package com.gifdialog;

import android.app.AlertDialog;
import android.content.Context;

/**
 * Created by brooks on 7/23/15.
 */
public class DialogUtil {
    GifDialog dialog;

    public GifDialog showGifdialog(Context mConext) {
        if (dialog != null) {
            return dialog;
        }

        dialog = new GifDialog(mConext, R.style.loading_dialog, "");
        dialog.setCancelable(true);
        dialog.setCanceledOnTouchOutside(true);

        return dialog;
    }

    public AlertDialog.Builder showErrDialog(final Context mContext, String Message) {

        AlertDialog.Builder builder = new AlertDialog.Builder(
                mContext);
        builder.setMessage(Message);
        builder.setCancelable(false);
        return builder;
    }

    public void hideGifDialog() {
        if (dialog != null) {
            dialog.dismiss();
        }
    }
}
